home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
1997.ZIP
/
WINDO28.ARC
/
WINDO28.DOC
< prev
next >
Wrap
Text File
|
1988-09-30
|
13KB
|
220 lines
Unit Windo28;
Interface
{ ===================================================================== }
{ WINDO - Windowing routines for Turbo PASCAL }
{ }
{ Author: Michael Burton }
{ 15540 Boot Hill Rd. }
{ Hayden Lake, ID 83835 }
{ (208) 772-9347 (after 1800 PST) }
{ Revision: 2.6 }
{ Date: 16 September 1987 }
{ }
{ Execute the WINTUTOR program for an explanation of use. }
{ }
{ This is a 'Shareware' program. If you find it to be of significant }
{ use to you, a $10 donation to the above address would be greatly }
{ appreciated. This would also place you on our mailing list to keep }
{ you informed of upgrades to Windo and of new programs. }
{ }
{ Modifications: }
{ DATE Rev Description }
{ 04 Mar 86 2.1 Make the heap available check properly }
{ 02 Jul 86 2.2 Get proper string length in GETDISP and DISPALL }
{ 03 Jul 86 2.3 Change Set_Cursor to properly handle monochrome }
{ 01 Oct 86 2.4 Change Bleep to sound like Oh, Oh. }
{ 20 Apr 87 2.5 Fix monochrome clrscr's of multiple windows }
{ 21 Sep 87 2.6 Fix lost interrupt problem in inline code }
{ Add shadow effects to windows }
{ Add title positioning to titlewindo }
{ Add attribute changes to titlewindo }
{ Add a real error sound routine }
{ Add an attribute function }
{ 05 Dec 87 2.7 Convert to a Turbo Pascal 4.0 Unit }
{ 30 Sep 88 2.8 Recompile for use with Turbo Pascal 5.0 }
{ ===================================================================== }
Uses Crt, Dos;
Type
windimtype = record
colb,rowb,cole,rowe,attrib,bordr,lastx,lasty,shad : byte;
end;
charptr = ^char;
winstr = string[80];
brdtype = record
ul,ur,ll,lr,hz,vtl,vtr: char;
end;
Const
maxwin = 30; { Total number of windows on screen at any time }
{ These constants should be used when defining the border type in a }
{ makewindo declaration }
noneb = 0; { No border }
singleb = 1; { Single border }
doubleb = 2; { Double border }
mixedb = 3; { Mixed border }
solidb = 4; { Solid border }
dimondb = 5; { Diamond border }
circleb = 6; { Circles border }
lhatchb = 7; { light hatch border }
mhatchb = 8; { medium hatch border }
dhatchb = 9; { dense hatch border }
{ These constants should be used when defining a shadow for a window }
{ in a makewindo declaration }
nones = 0; { no shadow }
lefts = 1; { shadow to the left }
rights = 2; { shadow to the right }
{ These constants should be used when defining the position of a title }
{ in a titlewindo declaration }
centert = 0; { center top title }
leftt = 1; { left top title }
rightt = 2; { right top title }
centerb = 3; { center bottom title }
leftb = 4; { left bottom title }
rightb = 5; { right bottom title }
brd: array[1..9] of brdtype = (
(ul:'┌';ur:'┐';ll:'└';lr:'┘';hz:'─';vtl:'│';vtr:'│'), { single }
(ul:'╔';ur:'╗';ll:'╚';lr:'╝';hz:'═';vtl:'║';vtr:'║'), { double }
(ul:'╒';ur:'╕';ll:'╘';lr:'╛';hz:'═';vtl:'│';vtr:'│'), { mixed }
(ul:'█';ur:'█';ll:'█';lr:'█';hz:'█';vtl:'▌';vtr:'▐'), { solid }
(ul:' ';ur:' ';ll:' ';lr:' ';hz:' ';vtl:' ';vtr:' '), { diamond}
(ul:' ';ur:' ';ll:' ';lr:' ';hz:' ';vtl:' ';vtr:' '), { circle }
(ul:'░';ur:'░';ll:'░';lr:'░';hz:'░';vtl:'░';vtr:'░'), { lhatch }
(ul:'▒';ur:'▒';ll:'▒';lr:'▒';hz:'▒';vtl:'▒';vtr:'▒'), { mhatch }
(ul:'▓';ur:'▓';ll:'▓';lr:'▓';hz:'▓';vtl:'▓';vtr:'▓')); { dhatch }
var
wndo : Array [0..maxwin] of windimtype; { window attributes }
wndoptr : Array [1..maxwin] of charptr; { pointer to window on heap }
tmpptr : charptr; { temporary pointer }
l_i : byte; { level index }
wndostr : winstr; { string for building wndos }
{ ===================================================================== }
{ GETDISP - Get an array of characters from the CRT display and store }
{ them in tostrng. }
{ The row and column inputs are relative to zero and are }
{ also relative to the entire screen, not any open window. }
{ }
{ Inputs: }
{ colb : byte; Starting column (0 - 79) }
{ rowb : byte; Starting row (0 - 24) }
{ len : byte; length of array }
{ tostrng : charptr; Pointer to character storage }
{ ===================================================================== }
Procedure GetDisp(colb,rowb,len : byte; tostrng : charptr);
{ ===================================================================== }
{ DISPALL - Display an array of characters and attributes on the CRT. }
{ The array is usually one that has been created using the }
{ GetDisp procedure. }
{ The row and column inputs are relative to zero and are }
{ also relative to the entire screen, not any open window. }
{ }
{ Inputs: }
{ colb : byte; Starting column (0 - 79) }
{ rowb : byte; Starting row (0 - 24) }
{ len : byte; length of array (not including attributes)}
{ fromstrng : charptr; Pointer to array to display }
{ ===================================================================== }
Procedure DispAll(colb,rowb,len : byte; fromstrng : charptr);
{ ===================================================================== }
{ DISPLINE - Display a string of characters on the CRT (with the same }
{ attributes) }
{ The row and column inputs are relative to zero and are }
{ also relative to the entire screen, not any open window. }
{ }
{ Inputs: }
{ colb : byte; Starting column (0 - 79) }
{ rowb : byte; Starting row (0 - 24) }
{ attrib : byte; Line attributes }
{ fromstrng : winstr; String to display }
{ ===================================================================== }
Procedure DispLine(colb,rowb,attrib : byte; VAR fromstrng : winstr);
{ ======================================================================== }
{ Bleep - Produce a bleeping sound times number of times }
{ }
{ Inputs: times : byte; The number of bleeps required }
{ ======================================================================== }
Procedure Bleep(times : byte);
{ ======================================================================== }
{ ErrorSound - Produce an error sound }
{ ======================================================================== }
Procedure ErrorSound;
{ ======================================================================== }
{ Wattr - Return a combined attributes byte }
{ ======================================================================== }
Function Wattr(text,backgnd: byte): byte;
{ ======================================================================== }
{ Set_Cursor - Set the cursor size }
{ Inputs: The number of cursor lines to display (0 -7, 0-14) }
{ ======================================================================== }
Procedure Set_Cursor (n: byte);
{ ===================================================================== }
{ INITWINDO - Initialize the window variables }
{ }
{ Use this routine before using MAKEWINDO, REMOVEWINDO or TITLEWINDO }
{ }
{ Inputs: }
{ txtcolor : byte; Starting text color }
{ bkgndclr : byte; Starting background color }
{ ===================================================================== }
Procedure InitWindo(txtcolor,bkgndclr : byte);
{ ===================================================================== }
{ MAKEWINDO - Create a window }
{ }
{ Inputs: }
{ colb : byte; Start column (1 - 80) }
{ rowb : byte; Start row (1 - 25) }
{ cole : byte; End column (1 - 80) }
{ rowe : byte; End row (1 - 25) }
{ tcolor : byte; Text color (0 - 15) }
{ tback : byte; Text background (0 - 7, > 7 for blinking) }
{ bordr : byte; Border indicator (0 - 9) }
{ shadoweffect : byte; The window's shadow (0 - 2) }
{ ===================================================================== }
Procedure MakeWindo(colb,
rowb,
cole,
rowe,
tcolor,
tback,
bordr,
shadoweffect : byte);
{ ===================================================================== }
{ REMOVEWINDO - Remove the last window created from the screen. To }
{ get back to the original screen, there must be as many }
{ Removewindos as there are Makewindos. }
{ }
{ Inputs: }
{ None }
{ ===================================================================== }
Procedure RemoveWindo;
{ ===================================================================== }
{ TITLEWINDO - Place a centered title in the top border of a window. }
{ }
{ Inputs: }
{ title : winstr; The title of the window }
{ position: byte; Where to put the title }
{ attr : byte; What colors to make the title }
{ ===================================================================== }
Procedure TitleWindo (title: winstr; position, attr: byte);